package ch.elektroplan.mueller.passwordSave.business.supporters;

import ch.elektroplan.mueller.passwordSave.business.interfaces.IEnigma;

public class Enigma implements IEnigma {

	public String decode(String text) {

		char[] temparr = text.toCharArray();

		for (int i = 0; i < temparr.length; i++) {

			temparr[i] += 1;
		}

		return new String(temparr);

	}

	public String encode(String text) {
		char[] temparr = text.toCharArray();

		for (int i = 0; i < temparr.length; i++) {

			temparr[i] -= 1;
		}

		return new String(temparr);
	}

}
